<template>
  <view>
    <view class="task-box"  @click="goMainTask(item.mainTaskVO.id)">
      <view class="task-info"><!-- v-if='item.mainTaskVO.completed == "进行中" || item.mainTaskVO.completed == "已完成"' -->
        <view class="task-title">
          <view class="image">
            <image src="/static/task-logo.png" mode=""></image>
          </view>
          <text>{{item.mainTaskVO.mainTaskName}}</text>
        </view>
        <view class="task-detail">
          <view class="task-integral">
            {{item.mainTaskVO.integral}}积分
          </view>
          <view class="devide">
            |
          </view>
          <view class="task-completeCount">
            已完成 :{{item.mainTaskVO.mainCount}}
          </view>
        </view>
      </view>
      <view class="task-status">
        {{item.mainTaskVO.completed == "已完成" ?'查看':'去完成'}}
      </view>
    </view>
  </view>
</template>
<script>
  export default {
    props: {
      item: Object
    },
    data() {
      return {
      }
    },
    methods: {
      goMainTask(id) {
        uni.navigateTo({
          url: '/subpkg/mainTask/mainTask?taskId=' + id
        })
      }
    }
  }
</script>
<style lang="scss">
  .task-box {
    display: flex;
    border: 1rpx solid #eee;
    padding: 60rpx 40rpx;
    background-color: #fff;

    .task-info {
      width: 380rpx;

      .task-title {
        display: flex;
        align-items: center;
        width: 380rpx;

        .image {
          width: 50rpx;
          height: 50rpx;

          image {
            width: 100%;
            height: 100%;
          }
        }

        text {
          width: 300rpx;
          margin-left: 20rpx;
          font-size: 36rpx;
        }
      }

      .task-detail {
        display: flex;
        margin-top: 30rpx;
        font-size: 30rpx;

        .task-integral {
          color: #046404;
        }

        .devide {
          margin: 0 20rpx;
          color: #ddd;
        }

        .task-completeCount {
          color: #555;
        }
      }
    }

    .task-status {
      width: 200rpx;
      height: 80rpx;
      margin-top: 20rpx;
      margin-left: 20rpx;
      border: 1rpx solid #b6eaae;
      border-radius: 16rpx;
      background-color: #b6eaae;
      color: #fff;
      font-weight: 700;
      font-size: 32rpx;
      text-align: center;
      line-height: 80rpx;
    }
  }
</style>